/**
* Class used to write a library to manage facilities to work with html
*
* Project: idbcrown
* Author:  TM
* Date:    14/02/2013
*
* History
* ------------------
* 14/02/2013 - TM - Initial version.
*/
 
 
package Util;

import java.io.*;

public class htmlTools
{
  /** Constants */
  public static String APP_SERVER_TITLE = "IDBCrown Server";
  /** Variables */
  protected PrintWriter out;
  
  /** Constructor */
  public htmlTools(PrintWriter outWriter)
  {
     out = outWriter;
  }
  
  /** Writes a header with some text */
  public void printHeader()
  {
    out.println("<HTML>");
    out.println("<HEAD>");
    out.println("<TITLE>"+APP_SERVER_TITLE+"</TITLE>");
    out.println("</HEAD>");
    out.println("<BODY>");
  }
  
  /** Writes a header with some text */
  public void printBody(String content)
  {
    out.println("<BODY>");
    out.println("<H1>"+content+"</H1>");
    out.println("</BODY>");
  }
  
  /** Writes a header with some text */
  public void printFooter()
  {
    out.println("</HTML>");
  }
  
  //STATIC SUPPORT

  /** Opens a tag for xml */
  public static String openTag(String tag)
  {
     return "<"+tag+">";
  }
  
  /** Closes a tag for xml */
  public static String closeTag(String tag)
  {
     return "</"+tag+">";
  }
  
  /** Opens and Close a tag for xml */
  public static String openCloseTag(String tag, String value)
  {
     return "<"+tag+">"+value+"</"+tag+">";
  }
  
  
    
}